import 'package:flutter/material.dart';
import 'package:sqflite_demo/page/shelf_page.dart';
import 'package:sqflite_demo/page/show_data.dart';
import 'package:sqflite_demo/router/context_extension.dart';


class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("首页"),
      ),
      body: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              TextButton(
                  onPressed: (){
                    context.routeTo(ShowData);
                  },
                  child: Text("前往数据显示区")
              ),
              TextButton(
                  onPressed: (){
                    context.routeTo(ShelfPage);
                  },
                  child: Text("前往书架")
              ),
            ],
          )
        ],
      ),
    );
  }
}
